﻿<Window x:Class="PizzaService.View.CreateNewFoodWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Neue Speise erstellen" Height="500" Width="600" Background="#FFA41B1B" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Styles\Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="AUTO"/>
            <RowDefinition Height="AUTO"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="AUTO"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.ColumnSpan="2"  HorizontalAlignment="Left" Text="Name: " Style="{StaticResource CustomTextBlockStyle}" Margin="5" Width="50"/>
        <TextBox Name="TxtName" Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" Text="{Binding Food.Name}" Style="{StaticResource CustomTextBoxStyle}" Margin="50,5,0,5" />
        <TextBlock Grid.Row="0" Grid.ColumnSpan="2"  HorizontalAlignment="Right" Text="Typ: " Style="{StaticResource CustomTextBlockStyle}" Margin="0,5,100,5" Width="50"/>
        <ComboBox Name="ComboType" Grid.Row="0" Grid.Column="1" Width="100" Height="25" ItemsSource="{Binding Types}" HorizontalAlignment="Right" Margin="5"></ComboBox>
        <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Text="Preis (klein):" Width="200" Style="{StaticResource CustomTextBlockStyle}" Margin="5"/>
        <TextBox Name="TxtPreisKlein" Grid.Row="1" Grid.Column="0"  HorizontalAlignment="Center" Text="{Binding Food.Preis_klein}" Style="{StaticResource CustomTextBoxStyle}" Margin="5" TextAlignment="Center"/>
        <TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Text="Preis (groß):" Width="200" Style="{StaticResource CustomTextBlockStyle}" Margin="5"/>
        <TextBox Name="TxtPreisGross" Grid.Row="1" Grid.Column="1"  HorizontalAlignment="Center" Text="{Binding Food.Preis_groß}" Style="{StaticResource CustomTextBoxStyle}" Margin="5" TextAlignment="Center"/>
        <ListView Name="AddedZutaten" Button.Click="RemoveZutat_Click_1"  Grid.Row="2" Grid.Column="0"  Opacity="1" FontSize="14" ItemsSource="{Binding Food.Zutaten}" ItemContainerStyle="{StaticResource CustomItemContainerStlye}">
            <ListView.Background>
                <RadialGradientBrush>
                    <GradientStop Color="#FFCF5454"/>
                    <GradientStop Color="#FFA41B1B" Offset="1"/>
                </RadialGradientBrush>
            </ListView.Background>
            <ListView.View>
                <GridView ColumnHeaderContainerStyle="{StaticResource CustomHeaderStyle}">
                    <GridViewColumn Width="250" Header="Zutat" CellTemplate="{StaticResource RemoveZutat}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView Name="AllZutaten" Button.Click="AddZutat_Click_1"  Grid.Row="2" Grid.Column="1" Opacity="1" FontSize="14" ItemsSource="{Binding Zutaten}" ItemContainerStyle="{StaticResource CustomItemContainerStlye}">
            <ListView.Background>
                <RadialGradientBrush>
                    <GradientStop Color="#FFCF5454"/>
                    <GradientStop Color="#FFA41B1B" Offset="1"/>
                </RadialGradientBrush>
            </ListView.Background>
            <ListView.View>
                <GridView ColumnHeaderContainerStyle="{StaticResource CustomHeaderStyle}">
                    <GridViewColumn Width="250" Header="Zutat" CellTemplate="{StaticResource AddZutat}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Content="Cancel" Style="{StaticResource CustomButtonStyle}" Margin="5" Click="Button_Click_1" />
        <Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Content="OK" Margin="5" Click="Button_Click_2">
            <Button.Style>
                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CustomButtonStyle}">
                    <Setter Property="IsEnabled" Value="false" />
                    <Style.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding ElementName=TxtName, Path=(Validation.HasError)}" Value="false" />
                                <Condition Binding="{Binding ElementName=TxtPreisKlein, Path=(Validation.HasError)}" Value="false" />
                                <Condition Binding="{Binding ElementName=TxtPreisGross, Path=(Validation.HasError)}" Value="false" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="IsEnabled" Value="true" />
                        </MultiDataTrigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>
        </Button>
    </Grid>
</Window>
